/**
 * API服务统一导出模块
 * 对于毕业设计演示系统，使用简单直接的导出方式
 */

// 导入模块用于apiService组合
import authApiModule from './authApi';
import userApiModule from './userApi';
import newsApiModule from './newsApi';
import rightsApiModule from './rightsApi';
import roleApiModule from './roleApi';
import categoryApiModule from './categoryApi';
import regionApiModule from './regionApi';

// 导出基础API实例
export { default as api } from './axios';

// 导出API配置常量
export { 
  AuditState,
  PublishState
} from '../types/news';

// 导出默认导出的模块
export { default as authApi } from './authApi';
export { default as userApi } from './userApi';
export { default as newsApi } from './newsApi';
export { default as rightsApi } from './rightsApi';
export { default as roleApi } from './roleApi';
export { default as categoryApi } from './categoryApi';
export { default as regionApi } from './regionApi';

// 导出认证API
export { 
  login, 
  logout,
  verifyToken,
  initSystem
} from './authApi';

// 导出用户API
export {
  getUserProfile,
  getUserById,
  getUserList,
  updateUser,
  updateUserState,
  uploadAvatar,
  changePassword,
  addUser,
  deleteUser,
  patchUser
} from './userApi';

// 导出新闻API
export {
  getNewsList,
  getNewsById,
  getDraftNews,
  getAuditNews,
  getAuditNewsList,
  getUnpublishedNews,
  getPublishedNews,
  getSunsetNews,
  addNews,
  updateNews,
  deleteNews,
  submitNews,
  auditNews,
  publishNews,
  sunsetNews,
  unpublishNews,
  getNewsStats,
  getViewStatistics,
  getStarStatistics,
  getCompleteStatistics,
  getUserDashboardStats
} from './newsApi';

// 导出权限API
export {
  getRights,
  getRightsWithChildren,
  getUserRights,
  getRightsTree,
  updateRoleRights,
  updateRightState,
  updateChildRightState,
  deleteRight,
  deleteChildRight,
  getRightById,
  getChildRightById,
  addRight,
  updateRight,
  addChildRight,
  updateChildRight,
  checkPermission as rightsCheckPermission,
  getSidebarItems
} from './rightsApi';

// 导出角色API
export {
  getRoleList,
  getRoleById,
  addRole,
  updateRole,
  updateRoleRights as roleUpdateRoleRights,
  deleteRole,
  checkPermission as roleCheckPermission
} from './roleApi';

// 导出分类API
export {
  getCategories,
  getCategoryById,
  addCategory,
  updateCategory,
  deleteCategory
} from './categoryApi';

// 导出区域API
export {
  getRegions,
  getRegion,
  getUserAccessibleRegions,
  updateRegion,
  deleteRegion,
  addRegion,
  getRegionByValue
} from './regionApi';

// API服务聚合对象
const apiService = {
  authApi: authApiModule,
  userApi: userApiModule,
  newsApi: newsApiModule,
  rightsApi: rightsApiModule,
  roleApi: roleApiModule,
  categoryApi: categoryApiModule,
  regionApi: regionApiModule
};

export default apiService;